<div class="box box-primary">
    <div class="">
        <br/>

        <div class="box box-solid">
            <div class="box-body">
                <?php echo form_open(admin_url('members/index'), 'method="get" class=""'); ?>
                <div class="row">
                    <div class="col-md-10">

                        <div class="row">
                            <?php $row_ = 'col-xs-12 col-sm-6 col-md-2'; ?>
                            <div class="<?php echo $row_; ?>">
                                <div class="form-group">
                                    <label for="user_name">关键词</label>
                                    <input id="user_name" type="text" class="form-control input-sm"
                                           value="<?php echo($this->input->get('user_name')); ?>"
                                           name="user_name"></div>
                            </div>
                            <div class="<?php echo $row_; ?>">
                                <div class="form-group">
                                    <label for="status">用户状态</label>
                                    <?php echo form_dropdown('status', array('' => '选择') + $status, (isset($_GET['status']) ? $_GET['status'] : ''), 'class="form-control input-sm" id="status"'); ?>
                                </div>
                            </div>
                            <div class="<?php echo $row_; ?>">
                                <div class="form-group">
                                    <label for="access_type">用户组</label>
                                    <?php echo form_dropdown('access_type', array('' => '选择') + $user_types, (isset($_GET['access_type']) ? $_GET['access_type'] : ''), 'class="form-control input-sm" id="access_type"'); ?>
                                </div>
                            </div>
                            <div class="<?php echo $row_; ?>">
                                <div class="form-group">
                                    <label for="order_by">排序</label>
                                    <?php echo form_dropdown('排序', array('' => '选择') + $order_by, $this->input->get('order_by'), 'class="form-control input-sm" id="order_by"'); ?>
                                </div>
                            </div>
                            
                        </div>

                    </div>
                    <div class="col-md-2">
                        <div class="pull-right">
                            <button type="submit" class="btn btn-primary btn-sm">
                                查询
                            </button>
                            <a href="<?php echo admin_url('members'); ?>"
                               class="btn btn-info btn-sm">清除</a>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                </div>

                <?php echo form_close(); ?>
            </div>
        </div>
    </div>
    <?php if ($users) { ?>
        <?php echo form_open(admin_url('members/delete_bulk/' . $offset)); ?>
        <div class="box-body">
            <div>
                <div class="pull-left">
                    <a class="btn btn-primary" href="<?php echo admin_url('members/add/') ?>">添加用户</a>
                    <button onclick="return confirm('Are you sure you want to Delete?')" type="submit"
                            name="delete_bulk" class="btn btn-danger">删除所选
                    </button>
                </div>
                <div class="pull-right ul_no_m">
                    <?php echo $pagination; ?>
                </div>
            </div>
            <div class="clearfix"></div>
            <br/>

            <div class="table-responsive">
                <table class="table table-bordered">
                    <tbody>
                    <tr>
                        <th style="width: 20px"><input type="checkbox" id="check-all"></th>
                        <th style="width: 10px">#</th>
                        <th>用户名</th>
                        <th>电子邮箱</th>
                        <th>注册时间</th>
                        <th>状态</th>
                        <th style="width: 140px"></th>
                    </tr>
                    <?php foreach ($users as $user) { ?>
                        <tr>
                            <td class="small-col">
                                <input name="user_id[]" value="<?php echo $user->user_seq_id; ?>" type="checkbox">
                            </td>
                            <td><?php echo $user->user_seq_id; ?></td>
                            <td><?php echo $user->user_name; ?></td>
                            <td><?php echo $user->user_email; ?></td>
                            <td><?php echo $user->user_created ?></td>
                            <td><?php echo $user->user_status_name ?></td>
                            <td>
                                <a class="btn btn-xs btn-info"
                                   href="<?php echo admin_url('members/edit/' . $user->user_seq_id . '/' . $offset); ?>"><span
                                        class="glyphicon glyphicon-edit"></span> 编辑</a>
                                <a class="btn btn-xs btn-danger"
                                   onclick="return confirm('Are you sure you want to Delete <?php echo $user->user_email; ?>?')"
                                   href="<?php echo admin_url('members/delete/' . $user->user_seq_id . '/' . $offset); ?>"><span
                                        class="glyphicon glyphicon-remove"></span> 删除</a>
                            </td>
                        </tr>
                    <?php } ?>
                    </tbody>
                </table>
            </div>
        </div>
        <div class="box-footer clearfix">
            <div>
                <div class="pull-left">
                    <a class="btn btn-primary" href="<?php echo admin_url('members/add/') ?>">添加用户</a>
                    <button onclick="return confirm('Are you sure you want to Delete?')" type="submit"
                            name="delete_bulk" class="btn btn-danger">删除所选
                    </button>
                </div>
                <div class="pull-right ul_no_m">
                    <?php echo $pagination; ?>
                </div>
            </div>
        </div>
        <?php echo form_close(); ?>
    <?php } else { ?>
        <div class="callout callout-warning">
            <h4>还没有会员呢!</h4>

            <p>还没有会员呢!你可以点击 <a href="<?php echo admin_url('members/add'); ?>">这里</a>添加用户.</p>
        </div>
    <?php } ?>
</div>

